﻿using LabManagement.Data.DataUtilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LabManagement.Data
{
    public class UserAccountUtil : BaseDataUtils
    {
        public UserAccountUtil(DataManager bridge) :base(bridge){
            
        }

         public bool IsValid(string username, string password)
         {
             return this.Bridge.DataFactory.Users.Any(u => u.UserName == username && u.UserPassword == password);             
         }
         public bool IsValidAdmin(string username, string password)
         {
             return this.Bridge.DataFactory.Users.Any(u => u.UserName == username && u.UserPassword == password && u.IsAdmin==true);
         }
    }
}
